﻿using AleaBelli.Core.Data;
using AleaBelli.Core.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AleaBelli.Core.AI
{
    /// <summary>
    /// 
    /// Assumes that units have been split into battle lines
    /// 
    /// Combat algoritmn
    /// 
    /// For each round
    /// 
    ///   Increase duration
    ///   HasDuration expired - return stalemate
    /// 
    ///   Reduce defenders orgaization (so if a unit fights in 2 sub battles it loses 1 point of organization)
    ///
    ///   For each sub battle
    ///   
    ///     For each 'attack' ( 1 per attack tempo e.g. assault = 3 )
    ///        Reduce attacker by 1 organisation
    ///        
    ///        Simulateous...
    ///          Attacker Fires 
    ///          Defender Fires 
    /// 
    ///   IsComplete ?
    /// 
    ///   Firing
    ///     EffectiveAttack = MIN(STR, ORG) * AttackValue * Leadership * TerrainMod * Weather * Doctrines
    ///     EffectiveDefense = MIN(STR, ORG) * DefenseValue * Leadership * TerrainMod * Entrenchment * Weather * Doctrines
    ///     
    /// 
    /// 
    /// </summary>
    public class SimpleCombatAlgorithmn : AbstractCombatAlgorithmn, ICombatAlgorithmn
    {
        private static Logger logger = Util.Logger.Instance;
        
        public BattleResult FightBattle(Battle b)
        {
            InitBattle(b);

            return BattleResult.Stalemate;
        }

        /// <summary>
        /// Initiate the battle
        /// </summary>
        /// <param name="b"></param>
        public override void InitBattle(Battle b)
        {
            // call the base class
            base.InitBattle(b);

            // add new behaviour

        }

        public void FightRound()
        {
        }
    }
}
